package demo2;
class Singleton{
    private static Singleton instance=new Singleton();
    public static Singleton getInstance(){
        return instance;
    }
    private Singleton(){

    }
}
public class test {
    public static void main(String[] args) {
        // Singleton singleton=new Singleton();
      Singleton t1=Singleton.getInstance();
        Singleton t2=Singleton.getInstance();

        System.out.println(t1==t2);
    }
}
